An Implementation of Modular Monadic Semantics using Folds and Monadic Folds*
نویسنده
چکیده
Modular monadic semantics can be implemented using folds or catamorphisms over a functor that expresses the abstract syntax of the language. By composing several functors, it is possible to obtain modular interpreters from reusable components. Monadic folds structure programs that process recursively their input and control the side effects of the output they produce. We consider that the semantic specification of a programming language is a natural framework for monadic folds that improves the abstraction level and modularity. In this paper we use folds and monadic folds to develop the modular monadic semantics of a simple language.
منابع مشابه
Modular Denotational Semantics for Compiler Construction ? Sheng
We show the benefits of applying modular monadic semantics to compiler construction. Modular monadic semantics allows us to define a language with a rich set of features from reusable building blocks, and use program transformation and equational reasoning to improve code. Compared to denotational semantics, reasoning in monadic style offers the added benefits of highly modularized proofs and m...
متن کاملModular Denotational Semantics for Compiler Construction
We show the benefits of applying modular monadic semantics to compiler construction. Modular monadic semantics allows us to define a languagewith a rich set of features from reusable building blocks, and use program transformation and equational reasoning to improve code. Compared to denotational semantics, reasoning in monadic style offers the added benefits of highly modularized proofs and mo...
متن کاملLifting of operations in modular monadic semantics
Monads have become a fundamental tool for structuring denotational semantics and programs by abstracting a wide variety of computational features such as side-effects, input/output, exceptions, continuations and non-determinism. In this setting, the notion of a monad is equipped with operations that allow programmers to manipulate these computational effects. For example, a monad for side-effec...
متن کاملModel-Driven Engineering from Modular Monadic Semantics: Implementation Techniques Targeting Hardware and Software
Recent research has shown how the formal modeling of concurrent systems can benefit from monadic structuring. With this approach, a formal system model is really a program in a domain specific language defined by a monad for shared-state concurrency. Can these models be compiled into efficient implementations? This paper addresses this question and presents an overview of techniques for compili...
متن کاملTowards Semantics-directed System Design and Synthesis
High assurance systems have been defined as systems “you would bet your life on.” This article discusses the application of a form of functional programming— what we call “monadic programming”—to the generation of high assurance and secure systems. Monadic programming languages leverage algebraic structures from denotational semantics and functional programming—monads—as a flexible, modular org...
متن کامل